﻿<%@ Page Title="销售报表" Language="C#" MasterPageFile="~/POS/POS.Master" AutoEventWireup="true" CodeBehind="SoReport.aspx.cs" Inherits="Me.Amon.POS.SoReport" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/Scripts/highcharts/highcharts.js"></script>
    <script type="text/javascript" src="/Scripts/highcharts/modules/exporting.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <table border="0" cellpadding="0" cellspacing="0" width="920">
        <tr>
            <td>
                销售日期：<asp:TextBox ID="TbDate" runat="server"></asp:TextBox>
                <juice:Datepicker ID="DpDate" runat="server" TargetControlID="TbDate" DateFormat="yy-mm-dd" />
                <asp:Button ID="BtSelect" runat="server" Text="查看" OnClick="BtSelect_Click" />
                <asp:HiddenField ID="HfDates" runat="server" />
                <asp:HiddenField ID="HfDatet" runat="server" />
            </td>
        </tr>
        <tr>
            <td>
                <div id="container" style="min-width: 400px; height: 400px; margin: 0 auto; width: 900px;">
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <table border="0" cellpadding="4" cellspacing="0" class="data_list" width="100%">
                    <tr class="data_head">
                        <th style="width: 80px;">
                            编号
                        </th>
                        <th>
                            终端
                        </th>
                        <th>
                            品类数量
                        </th>
                        <th>
                            商品数量
                        </th>
                        <th>
                            订单金额
                        </th>
                        <th>
                            折扣金额
                        </th>
                    </tr>
                    <asp:Repeater ID="RpVips" runat="server">
                        <ItemTemplate>
                            <tr class="data_rowd">
                                <td>
                                    <a href="SoDetail.aspx?so=<%# Eval(Me.Amon.Da.Db.POS.DSoHeader.ID) %>" title="点击查看详情" target="_blank">
                                        <%# Eval(Me.Amon.Da.Db.POS.DSoHeader.CODE) %></a>
                                </td>
                                <td>
                                    <%# Eval(Me.Amon.Da.Db.POS.DSoHeader.TERMINAL)%>
                                </td>
                                <td>
                                    <%# Eval(Me.Amon.Da.Db.POS.DSoHeader.ITEM_QTY)%>
                                </td>
                                <td>
                                    <%# Eval(Me.Amon.Da.Db.POS.DSoHeader.UNIT_QTY)%>
                                </td>
                                <td>
                                    <%# Me.Amon.Util.CharUtil.FormatPrice(Eval(Me.Amon.Da.Db.POS.DSoHeader.ORDER_AMOUNT)) %>
                                </td>
                                <td align="right">
                                    <%# Me.Amon.Util.CharUtil.FormatPrice(Eval(Me.Amon.Da.Db.POS.DSoHeader.ROUND_AMOUNT)) %>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <tr class="data_rowd">
                                <td>
                                    <a href="SoDetail.aspx?so=<%# Eval(Me.Amon.Da.Db.POS.DSoHeader.ID) %>" title="点击查看详情" target="_blank">
                                        <%# Eval(Me.Amon.Da.Db.POS.DSoHeader.CODE) %></a>
                                </td>
                                <td>
                                    <%# Eval(Me.Amon.Da.Db.POS.DSoHeader.TERMINAL)%>
                                </td>
                                <td>
                                    <%# Eval(Me.Amon.Da.Db.POS.DSoHeader.ITEM_QTY)%>
                                </td>
                                <td>
                                    <%# Eval(Me.Amon.Da.Db.POS.DSoHeader.UNIT_QTY)%>
                                </td>
                                <td>
                                    <%# Me.Amon.Util.CharUtil.FormatPrice(Eval(Me.Amon.Da.Db.POS.DSoHeader.ORDER_AMOUNT)) %>
                                </td>
                                <td align="right">
                                    <%# Me.Amon.Util.CharUtil.FormatPrice(Eval(Me.Amon.Da.Db.POS.DSoHeader.ROUND_AMOUNT)) %>
                                </td>
                            </tr>
                        </AlternatingItemTemplate>
                    </asp:Repeater>
                    <tr>
                        <td colspan="7" align="right">
                            <asp:LinkButton ID="HlHome" runat="server" OnClick="HlHome_Click">首页</asp:LinkButton>
                            <asp:Label ID="LlPrev" runat="server">...</asp:Label>
                            <asp:LinkButton ID="HlPage1" runat="server" OnClick="HlPage1_Click">HyperLink</asp:LinkButton>
                            <asp:LinkButton ID="HlPage2" runat="server" OnClick="HlPage2_Click">HyperLink</asp:LinkButton>
                            <asp:LinkButton ID="HlPage3" runat="server" OnClick="HlPage3_Click">HyperLink</asp:LinkButton>
                            <asp:Label ID="LlNext" runat="server">...</asp:Label>
                            <asp:LinkButton ID="HlLast" runat="server" OnClick="HlLast_Click">尾页</asp:LinkButton>
                            <asp:Label ID="LlPage" runat="server">HyperLink</asp:Label>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <script type="text/javascript">
        var cats = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'];
        <asp:Literal ID="IdJson" runat="server"></asp:Literal>
        $(function () {
            var chart;
            $(document).ready(function () {
                chart = new Highcharts.Chart({
                    chart: {
                        renderTo: 'container',
                        type: 'line'
                    },
                    title: {
                        text: '当日销售报表'
                    },
                    subtitle: {
                        text: '所有门店'
                    },
                    xAxis: {
                        categories: cats
                    },
                    yAxis: {
                        title: {
                            text: '单量'
                        }
                    },
                    tooltip: {
                        enabled: true,
                        formatter: function () {
                            return '<b>' + this.series.name + '</b><br/>' + this.x +'点：'+ this.y + '单';
                        }
                    },
                    plotOptions: {
                        line: {
                            dataLabels: {
                                enabled: true
                            },
                            enableMouseTracking: true
                        }
                    },
                    series: data
                });
            });

        });
    </script>
</asp:Content>
